//package com.digiwin.dap.middleware.iam.com.digiwin.middleware.core.serializer;
//
//import com.fasterxml.jackson.databind.BeanDescription;
//import com.fasterxml.jackson.databind.SerializationConfig;
//import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
//import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
//
//import java.com.digiwin.middleware.core.util.List;
//
///**
// * @author yanyn
// */
//public class CustomBeanSerializerModifier extends BeanSerializerModifier {
//
//    @Override
//    public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc,
//                                                     List<BeanPropertyWriter> beanProperties) {
//        // 循环所有的beanPropertyWriter
//        for (int i = 0; i < beanProperties.size(); i++) {
//            BeanPropertyWriter writer = beanProperties.get(i);
//            // 判断字段的类型
//            //writer.getType().getTypeName().contains("long")
//            if ("long".equals(writer.getPropertyType().getName())) {
//                //给writer注册一个自己的nullSerializer
////                beanProperties.set(i, new LongSerializer());
//                writer.assignSerializer(new LongSerializer());
//            }
//            if (writer.getPropertyType().getName().contains("LocalDate"))
//            {
//                writer.assignSerializer(new LocalDateSerializer());
//            }
//            if (writer.getPropertyType().getName().contains("LocalDateTime"))
//            {
//                writer.assignSerializer(new LocalDateTimeSerializer());
//            }
//            if (writer.getPropertyType().getName().contains("LocalTime"))
//            {
//                writer.assignSerializer(new LocalTimeSerializer());
//            }
//            if (writer.getPropertyType().getName().contains("Timestamp"))
//            {
//                writer.assignSerializer(new TimestampSerializer());
//            }
//        }
//        return beanProperties;
//    }
//}
